<%@ include file="/WEB-INF/views/taglib.jsp" %>
<h3>Vehicle Form</h3>	
	<form:form id="form" method="post" modelAttribute="vehicle"  cssClass="simpleForm">
		
	 	<div class="clear" style="height:1px">&nbsp;</div>
		<jsp:include page="/WEB-INF/views/message.jsp"></jsp:include>
	  	<fieldset>
	  		<legend>Vehicle Info</legend>
	  		<aims:column cssErrorClass="error" path="vehicleId" >
	  		
	  		<form:label path="vehicleId">
	  			Taxi No  * 
	 		</form:label>
	 		<c:choose>
	 			<c:when test="${vehicle.dateCreated!=null}">
	 				<form:input path="vehicleId" disabled="true"/>
	 				<form:hidden path="vehicleId"/>
	 			</c:when>
	 			<c:otherwise>
	 				<form:input path="vehicleId" />
	 			</c:otherwise>
	 		</c:choose>
	  		<form:errors path="vehicleId"  cssClass="errorSimple" /> 
			</aims:column>
			<aims:column cssErrorClass="error" path="driverNric" >
	  		<form:label path="driverNric">
	  			Driver NRIC  * 
	 		</form:label>
	  		<form:input path="driverNric" /> <form:errors path="driverNric"  cssClass="errorSimple" /> 
			</aims:column>
			<aims:column cssErrorClass="error" path="driverName" >
	  		<form:label path="driverName">
	  			Driver Name  * 
	 		</form:label>
	  		<form:input path="driverName" /> <form:errors path="driverName"  cssClass="errorSimple" /> 
			</aims:column>
			<aims:column cssErrorClass="error" path="driverTelephoneNo" >
	  		<form:label path="driverTelephoneNo">
	  			Telephone No  * 
	 		</form:label>
	  		<form:input path="driverTelephoneNo" /> <form:errors path="driverTelephoneNo"  cssClass="errorSimple" /> 
			</aims:column>
			<aims:column cssErrorClass="error" path="driverEmail" >
	  		<form:label path="driverEmail">
	  			Email  * 
	 		</form:label>
	  		<form:input path="driverEmail" /> <form:errors path="driverEmail"  cssClass="errorSimple" /> 
			</aims:column>
			<aims:column cssErrorClass="error" path="meVersion" >
	  		<form:label path="meVersion">
	  			ME Version  * 
	 		</form:label>
	  		<form:input path="meVersion" /> <form:errors path="meVersion"  cssClass="errorSimple" /> 
			</aims:column>
			</fieldset>
      <div class="action">
	  	<c:choose>
	  		<c:when test="${vehicle.vehicleId==null}">
	  			<button type="submit" class="button positive">
	  			Save
	  			</button>
	  			<a href="<c:url value="/vehicle/search" />" class="button">Back</a>
	  		</c:when>
	  		<c:when test="${vehicle.vehicleId!=null}">
  				<button type="submit"  class="button positive">
  				Update</button>
  				<a href="<c:url value="/vehicle/search" />" class="button">Back</a>
	  		</c:when>
	  	</c:choose>
	 </div>	
	</form:form>
	<script type="text/javascript">
		$(document).ready(function() {
			
		});
	</script>